package rpcbiz

import (
	"strconv"
	"cloud_worm/util/unet/rpc"
	"cloud_worm/util/proto/urpc"
	"cloud_worm/access/config"
)


type ServerInfoArgs urpc.ServerInfoArgs
// ServerInfoArgs 参数处理
func (args * ServerInfoArgs) Param() error {
	return nil
}

// ServerAbout.GetServerInfo 获取服务的信息
func (s *ServerAbout) GetServerInfo(args *ServerInfoArgs, reply *urpc.ServerInfoReply) error {
	err := args.Param()
	if err != nil {
		return err
	}

	reply.Version = config.ConfInst.Version
	reply.Domain = config.ConfInst.Server.Domain
	reply.Status = 0
	reply.TCPPort, _ = strconv.Atoi(config.ConfInst.Server.AccessPort)
	reply.HTTPPort, _ = strconv.Atoi(config.ConfInst.Server.RpcPort)
	return nil
}

type ServerAbout int

// 初始化注册
func init()  {
	rpc.Register(new(ServerAbout))
}


